package com.cy.pj.common.util;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import javax.servlet.http.HttpServletRequest;

public class PageUtil {
    public static <T>Page<T> startPage(){
        HttpServletRequest request=ServletUtils.getRequest();
        String pageSizeStr=request.getParameter(("pageSize"));
        String pageCurrentStr=request.getParameter("pageCurrent");
        System.out.println("pageSize="+pageCurrentStr);
        System.out.println("pageCurrent="+pageCurrentStr);
        Integer pageCurrent=
                StringUtil.isEmpty(pageCurrentStr)?1:Integer.parseInt(pageCurrentStr);
        Integer pageSize=
                StringUtil.isEmpty(pageSizeStr)?5:Integer.parseInt(pageSizeStr);
        return PageHelper.startPage(pageCurrent,pageSize);
    }
}
